package org.example;

import com.deepoove.poi.XWPFTemplate;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Main {
    public static void main(String[] args) throws Exception {
        helloPoi();
    }

    private static void helloPoi() throws IOException {
        Map<String, Object> data = new HashMap<>();
        data.put("title", "这是一句测试");

        XWPFTemplate template = XWPFTemplate
                .compile("template.docx")
                .render(data);
        template.writeAndClose(new FileOutputStream("output.docx"));
    }
}